--Api 表
/*
select * from SYS_Apis
select * from SYS_ApiM --M  Memo Main Manage

ReturnType
返回类型（类似返回值）
1 execSql 
2 openSql
3 execProc(不带返回结果) 
4 openProc(带返回结果集)
5 getList (使用getList sql 模板)
*/

declare 
  @ApiName varchar(50)='tpl.treeList',
  @ReturnType int =5
--
--
delete from SYS_Apis where ApiName=@ApiName
delete from SYS_ApiM where apiName=@ApiName
insert into SYS_ApiM([apiName],[name],[memo])
select @ApiName,'获取模板tree','获取模板tree'
insert into SYS_Apis(ApiName,paramsLen,params,ReturnType,sqlText)
select @ApiName,0,
null,
@ReturnType,
'select jdmc as id,pjdmc as pid,jdlx as dglx,2 as nType from mbsjjd where mbmc=#para(templateName)
union all
select dgmc,jdmc,dglx,3 as nType from mbsjdg where mbmc=#para(templateName)
'
